<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<%@include file="../userInfo_inc.jsp" %>
<body>
<h1>指导教师列表</h1>
<c:url var="toExcel_url" value="/teacher/teacherToExcel.html"/>
<a href="${toExcel_url}">输出Excel文件</a>
<table border="1">	
	<c:forEach items="${teachers}" var="teacher">
		<tr>
			<td>${teacher.name}<td>
			<td>${teacher.title.description}<td>
			<td>${teacher.degree.description}<td>			
			<td>${teacher.department.description}</td>					
			
			<!-- 将id直接加入到url中 ，但一定要以html为扩展名-->
			<c:url var="edit_url" value="/teacher/updateTeacher/${teacher.id}.html">
			</c:url>						
			<c:url var="delete_url" value="/teacher/deleteTeacher/${teacher.id}.html">			
			</c:url>			
			<td>
			 		<a href="${edit_url}" >修改</a>	
					<a href="${delete_url}" >刪除</a>	
			</td>	
		</tr>	
	</c:forEach>	
		
</table>
<c:url var="add_url" value="/teacher/toAddTeacher.html"/>
<a href="${add_url}">增加毕业设计题目</a>
</body>
</html>